-
Notifications
You must be signed in to change notification settings - Fork 38.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extract GCEPD pv tests #40885
Extract GCEPD pv tests #40885
Conversation
Hi @copejon. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
cc @jeffvance |
39e665c
to
26c612a
Compare
test/e2e/persistent_volumes.go
Outdated
@@ -72,6 +71,19 @@ func completeMultiTest(f *framework.Framework, c clientset.Interface, ns string, | |||
deletePVCandValidatePVGroup(c, ns, pvols, claims) | |||
} | |||
|
|||
// Delete the nfs-server pod. | |||
func nfsServerPodCleanup(c clientset.Interface, config VolumeTestConfig) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it better to move this to pvutil.go?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see below
test/e2e/pvutil.go
Outdated
@@ -62,19 +62,6 @@ type persistentVolumeConfig struct { | |||
namePrefix string | |||
} | |||
|
|||
// Delete the nfs-server pod. Only done once per KubeDescription(). | |||
func nfsServerPodCleanup(c clientset.Interface, config VolumeTestConfig) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why move this func? Seems that any other provider that wants to run nfs to test their storage will want this func,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As it's written now, NFS has been an abstract way to provide a hostPath volume. Provider specific tests (e.g. GCE) define PVs that use the vendor's PersistentVolumeSource (like GCEPersistentDiskVolumeSource
). So I was thinking that it's only relevant to our NFS & disruptive suite.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Today I see nfsServerPodCleanup
called from these 2 files:
. test/e2e/persistent_volumes.go
. test/e2e/persistent_volumes-disruptive.go
and defined in pvutil.go.
So, since it is called by 2 pv related files, I still don't understand why it should not remain in pvutil.go...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, given that, I think you're right. Will move back to pvutil
I am not the right person to review this. cc @kubernetes/sig-storage-pr-reviews |
test/e2e/persistent_volumes-gce.go
Outdated
@@ -0,0 +1,138 @@ | |||
/* | |||
Copyright 2015 The Kubernetes Authors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2017
test/e2e/persistent_volumes-gce.go
Outdated
|
||
// Testing configurations of single a PV/PVC pair attached to a GCE PD | ||
var _ = framework.KubeDescribe("PersistentVolumes:GCEPD", func() { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
blank line
26c612a
to
35687cd
Compare
It lgtm... |
@@ -84,9 +96,6 @@ var _ = framework.KubeDescribe("PersistentVolumes [Volume][Serial]", func() { | |||
ns = f.Namespace.Name | |||
}) | |||
|
|||
/////////////////////////////////////////////////////////////////////// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keep these lines
test/e2e/pvutil.go
Outdated
@@ -62,19 +62,6 @@ type persistentVolumeConfig struct { | |||
namePrefix string | |||
} | |||
|
|||
// Delete the nfs-server pod. Only done once per KubeDescription(). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keep nfs functions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See below re: provider segregation.
As the primary persistent_volumes.go file will exclusively test against an NFS volume, it made more sense to keep NFS util code with those tests.
@copejon can you share more thought why extracting gce from persistent volumes and the works going forward depending on this refactoring? As none of other e2e test files are specific to a single cloudprovider, they share core functions among supported cloud. |
@rootfs This refactor is an attempt to preempt a situation where test suites for different providers are all clumped together in one file with the goal of improving structure and readability. We're beginning to see more tests coming in for PVs that are provider specific. GCE is already singled out; vSphere is now seeing targeted PV testing with #40756. Secondly, having each provider test and accompanying utility code in their own file will help to smooth transition as vendors move out of tree. |
SGTM, please rebase |
35687cd
to
897afcc
Compare
test/e2e/persistent_volumes.go
Outdated
pv, pvc := createPVPVC(c, pvConfig, ns, isPrebound) | ||
waitOnPVandPVC(c, ns, pv, pvc) | ||
// Delete the nfs-server pod. | ||
func nfsServerPodCleanup(c clientset.Interface, config VolumeTestConfig) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any callers of this func, so it should be deleted unless I missed one...
/approve |
163e086
to
4a28a1e
Compare
@k8s-bot test this |
4a28a1e
to
18cb2db
Compare
/approve |
18cb2db
to
f5a718c
Compare
@k8s-bot bazel test this |
f5a718c
to
8b71f46
Compare
cc @divyenpatel |
/lgtm |
@k8s-bot cvm gce e2e test this |
8b71f46
to
29d4c1c
Compare
@k8s-bot verify test this |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: copejon, jeffvance, mikedanese
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
Automatic merge from submit-queue |
What this PR does / why we need it:
This is strictly a refactor moving the GCEPD suite in Persistent Volumes E2E to it's own file. This will make future provider specific additions to pv testing much more organized and readable. It will also enable a smoother transition to providers moving out of tree by consolidating related tests.